﻿
//本文件提供创建甘特图、操作甘特图的相关全局方法。

function createGantt(el){      
    var project = new PlusProject();

    //设置甘特图列
    project.setColumns([
        new PlusProject.IDColumn(),
        new PlusProject.StatusColumn(),
        new PlusProject.ManualColumn(),
        new PlusProject.NameColumn(),
        //自定义编辑器
    {
        name: "aaa",
        header: "自定义编辑器",
        width: 80,
        field: "Notes",
        editor: {
            type: "mytextbox",
        }
    },
        new PlusProject.PredecessorLinkColumn(),
        new PlusProject.PercentCompleteColumn(),
        new PlusProject.DurationColumn(),
        new PlusProject.StartColumn(),
        new PlusProject.FinishColumn(),
        new PlusProject.WorkColumn(),
        new PlusProject.DepartmentColumn(),
        new PlusProject.PrincipalColumn(),
        new PlusProject.AssignmentsColumn()
    ]);

    //创建右键菜单
    var menu = new ProjectMenu();
    project.setContextMenu(menu);
    //menu.edit.on("click", function (e) {
    //    ShowTaskWindow(project);
    //});

    project.setStyle("width:100%;height:400px");

    return project;
}
